﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace UTIL
{
    public class KZTime
    {
        public static string ToString(double kzTime)
        {
            if (kzTime > 0)
            {
                TimeSpan kzTimeSeconds = TimeSpan.FromSeconds(kzTime);

                string ms = kzTimeSeconds.Milliseconds.ToString();

                if (ms.Length < 3)
                {
                    ms = String.Format("0{0}", ms);
                }

                string kzTimeStr = string.Format("{0:D2}:{1:D2}.{2}", kzTimeSeconds.Minutes, kzTimeSeconds.Seconds, ms.Substring(0, 2));

                return kzTimeStr;
            }
            else
            {
                return "**:**.**";
            }
        }
    }
}
